<template>
  <div class="header_container">
    <el-breadcrumb separator="/">
      <el-breadcrumb-item :to="{ path: '/userList' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item
        v-for="(item, index) in $route.meta"
        :key="index"
      >{{item}}</el-breadcrumb-item>
    </el-breadcrumb>

    <div
      class="span"
      @click="goBack()"
    >
      返回
    </div>
  </div>
</template>

<script>
import { signout } from "@/api/getData";
import { baseImgPath } from "@/config/env";
import { mapActions, mapState } from "vuex";

export default {
  data() {
    return {
      baseImgPath
    };
  },
  created() {
    // if (!this.adminInfo.id) {
    //   this.getAdminData();
    // }
  },
  // computed: {
  //   ...mapState(["adminInfo"])
  // },
  methods: {
    // ...mapActions(["getAdminData"]),
    async handleCommand(command) {
      if (command == "home") {
        this.$router.push("/manage");
      } else if (command == "singout") {
        const res = await signout();
        if (res.status == 200) {
          this.$message({
            type: "success",
            message: "退出成功"
          });
          this.$router.push("/");
        } else {
          this.$message({
            type: "error",
            message: res.msg
          });
        }
      } else if (command == "changePassword") {
        this.$router.push("/changePassword");
      }
    },
    goBack() {
      this.$router.go(-1);
    }
  }
};
</script>

<style lang="less">
@import "../style/mixin";
.avator {
  .wh(36px, 36px);
  border-radius: 50%;
  margin-right: 37px;
}
.el-dropdown-menu__item {
  text-align: center;
}
</style>
